home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / OLE2BOOK.ZIP / CHAP02.ZIP / CHAP02 / PATRON / MAKEFILE < prev    next >
Text File  |  1993-06-22  |  3KB  |  125 lines

  1. #
  2. # MAKEFILE
  3. # Patron version 2.0 Chapter 2
  4. #
  5. # Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  6. #
  7. # Kraig Brockschmidt, Software Design Engineer
  8. # Microsoft Systems Developer Relations
  9. #
  10. # Internet  :  kraigb@microsoft.com
  11. # Compuserve:  >INTERNET:kraigb@microsoft.com
  12. #
  13.  
  14. #Add '#' to the next line for 'noisy' operation
  15. !CMDSWITCHES +s
  16.  
  17. #
  18. #Compiler flags
  19. #Use "SET RETAIL=1" from MS-DOS to compile non-debug version.
  20. #
  21. !ifndef RETAIL
  22. CFLAGS  = -c -nologo -Od -AM -Zipe -G2s -W3 -GA -GEs
  23. LINK    = /al:16/ONERROR:NOEXE/CO
  24. DEFS    = -DSTRICT -DDEBUG
  25. !else
  26. CFLAGS  = -c -nologo -Oas -AM -Zpe -G2s -W3 -GA -GEs
  27. LINK    = /al:16/ONERROR:NOEXE
  28. DEFS    = -DSTRICT
  29. !endif
  30.  
  31.  
  32. !ifdef SDI
  33. DOC     = -DSDI
  34. CLASSLIB= classSDI
  35. DIR     = SDI
  36. SRC_DIR = ..
  37. !else
  38. DOC     = -DMDI
  39. CLASSLIB= classMDI
  40. DIR     = MDI
  41. SRC_DIR = ..
  42. !endif
  43.  
  44.  
  45. .SUFFIXES: .h .c .asm .obj .exe .cpp .res .rc
  46.  
  47. TARGET  = patron
  48.  
  49. goal:   cd_build $(TARGET).exe cd_src
  50.  
  51. cd_build:
  52.     cd $(DIR)
  53.  
  54. cd_src:
  55.     cd ..
  56.  
  57. clean:
  58.     cd $(DIR)
  59.     del *.obj
  60.     del *.res
  61.     del *.exe
  62.     cd ..
  63.  
  64.  
  65. INCLS    = $(SRC_DIR)\$(TARGET).H $(SRC_DIR)\resource.h
  66. LIBS     = libw mlibcew commdlg bttncur gizmobar stastrip $(CLASSLIB)
  67.  
  68. OBJS1    = $(TARGET).obj client.obj
  69. OBJS2    = document.obj
  70. OBJS3    = pages.obj pagewin.obj page.obj
  71. OBJS     = $(OBJS1) $(OBJS2) $(OBJS3)
  72.  
  73. RCFILES1 = $(SRC_DIR)\$(TARGET).ico $(SRC_DIR)\document.ico $(SRC_DIR)\about.dlg
  74. RCFILES2 = $(SRC_DIR)\gizmo72.bmp $(SRC_DIR)\gizmo96.bmp $(SRC_DIR)\gizmo120.bmp
  75. RCFILES  = $(RCFILES1) $(RCFILES2)
  76.  
  77.  
  78. #####
  79.  
  80. {$(SRC_DIR)}.cpp{}.obj:
  81.     echo ++++++++++
  82.     echo Compiling $*.cpp
  83.     cl $(CFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  84.  
  85.  
  86. {$(SRC_DIR)}.rc{}.res:
  87.     echo +++++++++
  88.     echo Compiling Resources
  89.     rc -r -i$(SRC_DIR) $(DEFS) $(DOC) -fo$@ $(SRC_DIR)\$*.rc
  90.  
  91.  
  92. #This rule builds a linker response file on the fly depending on debug flags
  93. $(TARGET).exe : $(OBJS) $(TARGET).res $(SRC_DIR)\$(TARGET).def
  94.     echo ++++++++++
  95.     echo Linking $@
  96.     echo +                                       > $(TARGET).lrf
  97.     echo $(OBJS1) +                             >> $(TARGET).lrf
  98.     echo $(OBJS2) +                             >> $(TARGET).lrf
  99.     echo $(OBJS3)                               >> $(TARGET).lrf
  100.  
  101.     echo $(TARGET) $(LINK)                      >> $(TARGET).lrf
  102.     echo nul/li                                 >> $(TARGET).lrf
  103.     echo $(LIBS) /NOD/NOE                       >> $(TARGET).lrf
  104.     echo $(SRC_DIR)\$(TARGET).def               >> $(TARGET).lrf
  105.  
  106.     link @$(TARGET).lrf
  107.     del $(TARGET).lrf
  108.     rc -v $(TARGET).res $(TARGET).exe
  109.  
  110.  
  111. ##### Dependencies #####
  112.  
  113. $(TARGET).res : $(SRC_DIR)\$(TARGET).rc $(INCLS) $(RCFILES)
  114.  
  115. #Application level things
  116. $(TARGET).obj : $(SRC_DIR)\$(TARGET).cpp $(INCLS)
  117. client.obj    : $(SRC_DIR)\client.cpp    $(INCLS)
  118.  
  119. #Document level things
  120. document.obj  : $(SRC_DIR)\document.cpp  $(INCLS) $(SRC_DIR)\pages.h
  121.  
  122. #Editor level things
  123. pages.obj     : $(SRC_DIR)\pages.cpp     $(INCLS) $(SRC_DIR)\pages.h
  124. pagewin.obj   : $(SRC_DIR)\pagewin.cpp   $(INCLS) $(SRC_DIR)\pages.h
  125.